.chat-container {
  height: 100%;
  display: flex;
}

/* 联系人列表样式 */
.contact-list {
  border-right: 1px solid #e8e8e8;
  transition: all 0.3s;
  max-width: 280px;
  min-width: 240px;
}

.contact-item {
  padding: 8px 12px !important;
  border-bottom: 1px solid #f0f0f0;
  cursor: pointer;
  transition: background-color 0.2s;
}

.contact-item:hover {
  background-color: #f5f5f5 !important;
}

.contact-item.active {
  background-color: #e6f7ff !important;
}

.contact-avatar {
  position: relative;
}

.contact-status {
  position: absolute;
  width: 8px;
  height: 8px;
  background-color: #52c41a;
  border-radius: 50%;
  border: 2px solid #fff;
  bottom: 0;
  right: 0;
  z-index: 1;
}

/* 消息气泡样式 */
.message {
  position: relative;
  margin-bottom: 6px;
  word-break: break-word;
  animation: fadeIn 0.3s ease;
  max-width: 85%;
  padding: 8px 12px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.message-outbound {
  background-color: #dcf8c6 !important;
  border-radius: 12px 2px 12px 12px !important;
  align-self: flex-end;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  position: relative;
  margin-right: 2px;
  color: #303030;
}

.message-outbound::before {
  content: '';
  position: absolute;
  right: -8px;
  bottom: 0;
  width: 16px;
  height: 16px;
  background-color: #dcf8c6;
  clip-path: polygon(0 0, 0% 100%, 100% 100%);
}

.message-inbound {
  background-color: #ffffff !important;
  border-radius: 2px 12px 12px 12px !important;
  align-self: flex-start;
  border: 1px solid #f0f0f0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
  position: relative;
  margin-left: 2px;
  color: #303030;
}

.message-inbound::before {
  content: '';
  position: absolute;
  left: -8px;
  bottom: 0;
  width: 16px;
  height: 16px;
  background-color: white;
  clip-path: polygon(100% 0, 100% 100%, 0 100%);
  border-bottom: 1px solid #f0f0f0;
  border-left: 1px solid #f0f0f0;
}

.message-sensitive {
  border: 1px solid #ff4d4f !important;
  background-color: #fff1f0 !important;
}

.message-sensitive.message-outbound::before {
  background-color: #fff1f0;
}

.message-sensitive.message-inbound::before {
  background-color: #fff1f0;
  border-bottom: 1px solid #ff4d4f;
  border-left: 1px solid #ff4d4f;
}

/* 消息列表区域 */
.messages-container {
  padding: 10px 16px;
  background-color: #f5f7f9;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  flex: 1;
  width: 100%;
}

/* 聊天头部 */
.chat-header {
  padding: 8px 16px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

/* 输入区域样式 */
.input-container {
  padding: 8px 16px 12px;
  background: #f9f9f9;
  border-top: 1px solid #f0f0f0;
}

.message-input {
  background: #fff;
  border-radius: 24px;
  padding: 4px 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  display: flex;
  align-items: flex-end;
}

.message-input textarea {
  border: none !important;
  box-shadow: none !important;
  padding: 6px 10px;
  resize: none;
  font-size: 14px;
  background: transparent;
}

.message-input textarea:focus {
  box-shadow: none !important;
  outline: none !important;
}

.message-input button {
  margin: 0 2px 2px 0;
}

/* 自定义滚动条 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: #f5f5f5;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: #a8a8a8;
}

/* 加载更多按钮 */
.load-more {
  text-align: center;
  margin: 6px 0;
}

/* 消息时间 */
.message-time {
  font-size: 10px;
  color: #8c8c8c;
  text-align: right;
  margin-top: 3px;
  display: flex;
  justify-content: flex-end;
  align-items: center;
}

/* 空状态 */
.empty-chat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 100%;
  background: #f5f7f9;
  width: 100%;
}

.empty-chat-card {
  width: 340px;
  text-align: center;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  padding: 30px 20px;
}

/* 动画效果 */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 响应式调整 */
@media (max-width: 768px) {
  .contact-list {
    width: 240px !important;
  }
  
  .message-outbound, .message-inbound {
    max-width: 90%;
  }
}

/* 输入指示器 */
.typing-indicator {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  background: #f0f0f0;
  border-radius: 10px;
  margin: 0 0 10px 4px;
}

.typing-dot {
  width: 6px;
  height: 6px;
  background: #666;
  border-radius: 50%;
  margin: 0 1px;
  animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { animation-delay: 0s; }
.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
  0%, 60%, 100% { transform: translateY(0); }
  30% { transform: translateY(-5px); }
}

/* 消息项 */
.ant-list-item {
  padding: 3px 0 !important;
  border: none !important;
}

/* 消息发送按钮悬停效果 */
.message-input button:hover {
  transform: scale(1.05);
  transition: transform 0.2s;
}

/* 添加触摸效果 */
.message:hover {
  opacity: 0.95;
  transition: opacity 0.2s;
}

/* 系统消息样式 */
.message-system {
  background-color: #f0f5ff !important;
  border-radius: 8px !important;
  align-self: center;
  border: 1px solid #d6e4ff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  max-width: 70%;
  margin: 8px auto;
  padding: 6px 12px;
}

.message-system::before,
.message-system::after {
  display: none;
}

/* CRM标签样式 */
.crm-tag {
  background-color: #e6f7ff;
  border: 1px solid #91d5ff;
  color: #1890ff;
  border-radius: 4px;
  padding: 0 6px;
  font-size: 10px;
  line-height: 16px;
  height: 16px;
  margin-left: 4px;
  font-weight: normal;
  display: inline-flex;
  align-items: center;
} 